<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/1/8
  Time: 21:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/style.css"/>
    <!--font-awesome字体图标库-->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/font-awesome.min.css"/>
    <script src="${pageContext.request.contextPath}/js/jquery-1.10.1.js" type="text/javascript" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
    <title>医院分诊管理系统首页</title>
    <style type="text/css">
        th {
            text-align: center;
        }
    </style>
</head>
<body>
<div class="container-fluid">
    <div class="row">
        <iframe src="${pageContext.request.contextPath}/iframe/nav.jsp" width="100%" frameborder="0"></iframe>
    </div>
    <!--按钮工具栏-->
    <div class="row">
        <div class="col-md-2"></div>
        <div class="col-md-2">
            <!--按钮组-->
            <div class="btn-group">
                <a href="${pageContext.request.contextPath}/manager/department/addDepartment.jsp" class="btn btn-info btn-sm"><span class="glyphicon glyphicon-plus"></span> 添加科室</a>
            </div>
        </div>
        <div class="col-md-3">
            <form action="${pageContext.request.contextPath}/department/showDepartment" class="form form-inline input-group">
                <input type="text" class="form-control" placeholder="请输入科室名" name="name" id="name" />
                <span class="input-group-btn"><input type="submit" class="btn btn-success" value="搜索" /></span>
            </form>
        </div>
        <div class="col-md-5"></div>
    </div>
    <div class="row">
        <div class="col-md-12"></div>
    </div>
    <!--信息管理table-->
    <div class="row">
        <div class="col-md-2"></div>
        <div class="col-md-8">
            <form action="${pageContext.request.contextPath}/department/removeAnyDepartment" method="get">
                <table class="table table-bordered table-condensed table-hover">
                    <thead>
                    <tr class="bg-info text-capitalize">
                        <th class="">
                            <input type="submit" value="删除选中" class="btn btn-danger btn-sm" />
                        </th>
                        <th>编号</th>
                        <th>名称</th>
                        <th>办公室电话</th>
                        <th>所在区域</th>
                        <th style="width: 20%;">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                        <c:forEach var="d" items="${list}">
                            <tr>
                                <td style="text-align: center;"><input type="checkbox" name="dids" value="${d.did}" /></td>
                                <td>${d.did}</td>
                                <td>${d.name}</td>
                                <td>${d.telephone}</td>
                                <td>${d.area}</td>
                                <td>
                                    <a href="${pageContext.request.contextPath}/department/removeDepartment?did=${d.did}" class="btn btn-xs btn-warning"><span class="glyphicon glyphicon-trash"></span> 删除</a>
                                    <a href="${pageContext.request.contextPath}/department/getOneDepartment?did=${d.did}" class="btn btn-xs btn-info"><span class="glyphicon glyphicon-edit"></span> 修改</a>

                                </td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </form>
        </div>
        <div class="col-md-2"></div>
    </div>
    <!--分页-->
    <div class="row">
        <div class="col-md-4"></div>

        <div class="col-md-4">
            <ul class="pager">
                <c:if test="${pageNum>1}">
                    <li class="previous"><a href="${pageContext.request.contextPath}/department/showDepartment?pageNum=${pageNum-1}&name=${name}" class="btn btn-default">上一页</a></li>
                </c:if>
                <li><a href="#" class="btn btn-default active disabled">第${pageNum}页</a></li>
                <c:if test="${pageNum<totalPage}">
                     <li class="next"><a href="${pageContext.request.contextPath}/department/showDepartment?pageNum=${pageNum+1}&name=${name}" class="btn btn-default">下一页</a></li>
                </c:if>
            </ul>

        </div>
        <div class="col-md-4"></div>
    </div>
    <div class="row">
        <div class="com-md-12">
            <!--底部-->
            <footer class="modal-footer navbar-fixed-bottom">
                <div class="row">
                    <div class="col-md-2"></div>
                    <div class="col-md-8" style="text-align: left;">
                        &trade;百知教育 网址:<a href="http://www.baizhiedu.com">http://www.baizhiedu.com</a>
                    </div>
                    <div class="col-md-2"></div>
                </div>
            </footer>
        </div>
    </div>
</div>
</body>
</html>

